import torch
from torch import nn
import torch.nn.functional as F


in_ = torch.arange(1, 5, dtype=torch.float32).view(1, 1, 2, 2)
print(in_)
#mode有'nearest', 'linear', 'bilinear', 'bicubic' , 'trilinear'和'area'. 默认使用'nearest'
x = F.interpolate(input, scale_factor=2, mode='nearest')
print(x)
x = F.interpolate(input, scale_factor=2, mode='bilinear', align_corners=True)
print(x)

